/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import com.google.inject.Inject;

/**
 *
 * @author think
 */
public class RealMachine extends AbstractMachine {

    private STAFHelper stafHelper;
    private ConfigManager configManager;

    @Inject
    public RealMachine(ConfigManager configManager, STAFHelper stafHelper) {
        this.configManager = configManager;
        this.stafHelper = stafHelper;
    }

    public boolean isStarted() {
        return stafHelper.isMachineAlive(this.getName());
    }

    public boolean getProjectArchive() {
        return stafHelper.copyFile("local", configManager.getProjectArchiveName(), this.getName(), this.getTsProjectArchive());
    }

    public boolean extractProjectArchive() {
        return stafHelper.unzip(this.getName(), this.getTsProjectArchive(), this.getTsProjectPath());
    }

}
